using System;
using System.Windows;

namespace DesktopWidgetApp.Client.Services
{
    /// <summary>
    /// 应用程序服务类
    /// 简化版本，不依赖缺失的服务类
    /// </summary>
    public class AppService : IDisposable
    {
        private bool _isDisposed = false;

        /// <summary>
        /// 当前用户ID
        /// </summary>
        public Guid CurrentUserId { get; private set; }

        /// <summary>
        /// 获取状态服务
        /// </summary>
        public StatusService StatusService { get; private set; }

        /// <summary>
        /// 获取状态同步辅助类
        /// </summary>
        public StatusSyncHelper StatusSyncHelper { get; private set; }

        /// <summary>
        /// 获取数据同步管理器
        /// </summary>
        public DataSyncManager DataSyncManager { get; private set; }

        /// <summary>
        /// 获取样式管理器
        /// </summary>
        public StyleManager StyleManager { get; private set; }

        /// <summary>
        /// 构造函数
        /// </summary>
        public AppService()
        {
            try
            {
                // 初始化简化版的服务
                CurrentUserId = new Guid("12345678-1234-1234-1234-123456789012");
                StatusService = new StatusService();
                StatusSyncHelper = new StatusSyncHelper();
                DataSyncManager = new DataSyncManager();
                StyleManager = new StyleManager();
            }
            catch (Exception ex)
            {
                MessageBox.Show("初始化应用服务失败: " + ex.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }

        /// <summary>
        /// 释放资源
        /// </summary>
        public void Dispose()
        {
            if (!_isDisposed)
            {
                _isDisposed = true;
            }
        }
    }
}